package com.city.repository.supervise;

import com.city.domain.supervise.ImpOrganization;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author: Xln_z
 * @date: 2018/8/24
 * @decription:
 **/

@Repository
public interface ImpOrganizationRepository extends JpaRepository<ImpOrganization, Integer> {

    @Query(value = "select * from imp_organization_manage limit ?1,?2 ", nativeQuery = true)
    List<ImpOrganization> getImpOrganizationLimit(Integer limitPage, Integer limitNum);

    @Query(value = "select * from imp_organization_manage where (organize_name like %?3% or tellphone like %?3%) limit ?1,?2 ", nativeQuery = true)
    List<ImpOrganization> getImpOrganizationLimit(Integer limitPage, Integer limitNum, String search);

}
